package com.treasure.mall.zbqmallmanager.vo;

import com.treasure.mall.biz.entity.user.UserPO;
import com.treasure.mall.biz.vo.BaseVO;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author allan
 * @version 1.0.0
 * @date 2020/6/16
 */
@Data
@NoArgsConstructor
public class FindUserVO implements BaseVO {
    private static final long serialVersionUID = -5890122503981621873L;

    private Long userId;
    private String nickname;
    private String mobile;

    public FindUserVO(UserPO userPO) {
        this.userId = userPO.getUserId();
        this.nickname = userPO.getNickName();
        this.mobile = userPO.getMobile();
    }

    public String getMobile() {
        return mobile.replaceAll("(\\d{3})\\d{4}(\\d{4})", "$1****$2");
    }
}
